package com.qy.changemachine.api

import com.qy.changemachine.dataBean.DeviceInfoRequest
import com.qy.changemachine.dataBean.DeviceInfoResponse
import com.qy.changemachine.dataBean.InitRequest
import com.qy.changemachine.dataBean.InitResponse
import com.qy.changemachine.dataBean.UpdateInfoResponse
import okhttp3.ResponseBody
import retrofit2.Response
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Query
import retrofit2.http.Streaming
import retrofit2.http.Url


interface ApiService {

    @POST("/api/v1/cloudInit")
//    @POST("/m2/4796545-4450736-default/218735343")
    suspend fun initPhone(@Body request: InitRequest): InitResponse

    @Streaming
    @GET
    suspend fun downloadFile(@Url fileUrl: String): Response<ResponseBody>

    @POST("/api/v1/cloudModel")
//    @POST("/m2/4796545-4450736-default/218735343")
    suspend fun getChangePhoneInfo(@Body request: DeviceInfoRequest): DeviceInfoResponse


    // GET 请求
    @GET("/api/v1/cloudInstall")
    suspend fun getUpdateInfo(): UpdateInfoResponse

    @GET
    suspend fun getChangePhoneInfo_new(@Url fullUrl: String): DeviceInfoResponse
}